<!--
  Include this file everywhere to check if there is a session. Like so:
	$root = $_SERVER['DOCUMENT_ROOT'];
	include('util/session.php');
-->
<?php
	include($root . "/util/config.php");//loads database stuff
	if(session_id() == '')
	{
		session_start();
	}
	if(!isset($_SESSION['login_user'])){	
		header("Location: ../login.php");
 		die();
    }
	$check_user=$_SESSION['login_user'];
	$sql = mysqli_query($db,"select username from users where username = '$check_user'");
	$row = mysqli_fetch_array($sql,MYSQLI_ASSOC);
	$login_session = $row['username'];
?>
